package com.you.atlas.web.place.module.screen;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.NotePhotoService;
import com.you.common.webx.AuthContext;
import com.you.place.dal.dao.dataobject.NotePhotoDO;

public class NotePhotoView {

    @Autowired
    private NotePhotoService notePhotoQueryService;

    public void execute(@Param(name = "noteItemId") Long noteItemId, Context context) {
        // try query form memberId
        List<NotePhotoDO> notePhotoList = null;
        if (noteItemId == null) {

            notePhotoList = notePhotoQueryService.queryNotePhotoListByMemberId(AuthContext.getContext().getMemberId());

        } else {

            notePhotoList = notePhotoQueryService.queryNotePhotoList(noteItemId);
        }
        context.put("notePhotoList", notePhotoList);
    }
}
